{extend name="common/main"}

{block name="css"}
<!-- 本页面需要额外添加的css请在此处添加 -->

<link rel="stylesheet" type="text/css" href="/mobiled/css/catalog.css">
{/block}
{block name="body"}
<body>

<div class="category-box">
    <div class="category1" style="outline: none; overflow: hidden;" tabindex="5000">
        <ul class="clearfix" style="padding-bottom:50px;">
            {foreach name="Comms" key="k" item="v"}
            {notempty  name="v.id"}
            <li {if reset($Comms)==$v}class="cur" style="margin-top:46px"{/if}data-id="{$v.id}">{$v.mobile_name}
            </li>
            {/notempty}
            {/foreach}
        </ul>
    </div>
    <div class="category2" style="outline: none; overflow: hidden;" tabindex="5001">
        <!--1级-->
        {foreach name="Comms" key="k" item="value"}
        <dl style="margin-top: 46px; padding-bottom: 50px;  {if  reset($Comms)==$value}display:block;{else/}display:none;{/if};" data-id="{$value.id}">
            <span>
                <a href="javascript:void(0);">
                    <img src="/images/classtable.jpg" title="" style="">
                </a>
		    </span>
            {notempty  name="value.menu"}
            <!--2级-->
            {foreach name="value.menu" key="k" item="v"}


            <dt><a href="{:url('Goods/search')}?q={$v.mobile_name}">{$v.mobile_name}</a></dt>
            <dd>
                <div class="fenimg">
                    <!--3级-->
                    {notempty  name="v.menu"}
                    {foreach name="v.menu" key="k" item="val"}
                    <div class="fen">
                        <a href="{:url('Goods/search')}?q={$val.mobile_name}">{$val.mobile_name}</a>
                    </div>
                    {/foreach}
                    {/notempty}
                </div>
            </dd>

            {/foreach}
            {/notempty}

        </dl>
        {/foreach}
    </div>
</div>


{include file="common/bar"}
</body>
{/block}

{block name="js"}
<script>
    $(function () {

        $(".clearfix").children().click(function () {
            $('.clearfix').children().removeClass('cur');//样式初始化
            $(this).addClass('cur');//选中改变样式
            $code =$(this).attr('data-id');

            $('.category2').children().css('display','none');
            $('[data-id='+$code+']').css('display','block');
        })
    })

</script>
<!-- 本页面需要额外添加的js请在此处添加 -->

{/block}